<?php

namespace frontend\controllers;

use bc\controller\FrontController;

class ChildController extends FrontController
{
	/**
	 * 题目检测
	 * 
	 * @author pwstrick
	 */
	public function actionIndex()
	{
		$data = array (
				'title' => '无创分诊检测试题',
				'css' => [ 
						'/sites/css/v1.1/gene.css',
						'/sites/css/v1.1/common.css' 
				],
				'js' => [ 
						'/sites/js/gene.js' 
				] 
		);
		
		$view = [];		
		return $this->render('index', $view);
	}
	
	/**
	 * 提示页面
	 * 
	 * @author pwstrick
	 */
	public function actionPrompt()
	{
		$test1 = $this->post ( 'test1' );
		$test2 = $this->post ( 'test2' );
		$test3 = $this->post ( 'test3' );
		$test4 = $this->post ( 'test4' );
		$test5 = $this->post ( 'test5' );
		$test6 = $this->post ( 'test6' );
		$test7 = $this->post ( 'test7' );
		$test8 = $this->post ( 'test8' );
		$test9 = $this->post ( 'test9' );
		$test10 = $this->post ( 'test10' );
		$result = 0;
		if ($test1 == 3 || $test3 == 3 || $test4 == 3 || $test5 == 4 || $test6 == 3 || $test9 == 2 || $test9 == 3)
		{
			$result = 1;
		}
		elseif ($test1 == 2 || $test2 == 1 || $test4 == 2 || $test5 == 3 || $test6 == 2 || $test7 == 1 || $test8 == 1 || $test9 == 4)
		{
			$result = 2;
		}
		elseif ($test10 == 1)
		{
			$result = 3;
		}
		elseif ($test10 == 2)
		{
			$result = 4;
		}
		
		$view ['result'] = $result;
		
		return $this->render('prompt', $view);
	}
	
	/**
	 * 介绍页面
	 */
	public function actionIntro()
	{
		return $this->render('intro');
	}
}

